/*
 * Caja.java
 *
 * Created on 25 de marzo de 2008, 15:01
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package mvc.wiew;

import java.awt.Color;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 *
 * @author notebook
 */
public abstract class Caja  extends JPanel{
    public final static int 
            h0=24, h1=h0*6, hb=30,
            w0=400, w1= 80, espesor=2;
    public final static Color bg=new Color(127,100,128), fg=new Color(127,10,240);
    
    private JLabel rotulo= new JLabel("");
    
    protected JComponent comp;
    
    /** Creates a new instance of Caja */
    protected Caja() {
        setBounds(0,0,w0,h0);
        setLayout(null);
        rotulo.setBounds(espesor,espesor,w1-2*espesor, h0-2*espesor);
        add(rotulo);
        setBackground(bg);
    }
    
    public void setPosicion(int x, int y){
        setLocation(x,y);
    }
    
    public void setRotulo(String r){
        rotulo.setText(r);
    }
    
    public abstract void set(String s);
    public abstract String get();
    
    public String toString(){
        return "Caja ";
    }
    
//    public static Caja creo(String s){
//        Caja c= new Caja();
//        c.setRotulo(s);
//        return c;
//    }
}
